package com.sgu6.redis.threads;



import com.sgu6.redis.cache.OrderCache;
import com.sgu6.redis.dto.OrderInfoCacheDto;

/**
 * Created by root on 17-12-4.
 * 实时保存订单信息到缓存
 *
 * @author sam
 */
public class SaveOrderCacheThread implements Runnable {
    private Integer finishNum;
    private String orderNo;
    private Integer goodNum;

    public SaveOrderCacheThread(Integer finishNum, String orderNo, Integer goodNum) {
        this.finishNum = finishNum;
        this.orderNo = orderNo;
        this.goodNum = goodNum;
    }

    @Override
    public void run() {
//        OrderInfoCacheDto orderInfoCacheDto = OrderCache.getOrder(orderNo);
//        if (null != orderInfoCacheDto) {
//            orderInfoCacheDto.setMakeNum(finishNum);
//            OrderCache.saveOrder(orderInfoCacheDto);
//        } else {
//            OrderInfoCacheDto orderInfo = new OrderInfoCacheDto();
//            orderInfo.setOrderNo(orderNo);
//            orderInfo.setFinishNo(goodNum);
//            orderInfo.setMakeNum(finishNum);
//            OrderCache.saveOrder(orderInfo);
//        }
    }
}
